using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Betfair.Api;
using Betfair.Api.Types;
using Bull.Core;

namespace Bull.Plugins.Market.ViewModels {
    public sealed class EventTypeViewModel : ViewModelBase {
        public int Id { get; private set; }
        public string Name { get; private set; }
        public ObservableCollection<EventViewModel> Events { get; private set; }

        public EventTypeViewModel(EventType eventType, IEnumerable<Event> events) {
            Id = eventType.Id;
            Name = eventType.Name;
            Events = new ObservableCollection<EventViewModel>(events.Select(evt => new EventViewModel(evt)));
        }

    }
}